1. Field of the Invention
The apparatus and method of the present invention generally relates to digital data processing systems and more particularly to a method of determining the maximum physical memory present in a data processing system and for detecting attempts to access nonexistent memory.
2. Description of the Prior Art
Digital data processing systems generally comprise a central processing unit (CPU), a main memory and one or more input/output devices such as card readers, magnetic tape readers, magnetic disks and printers, which are interfaced to the CPU and main memory via input/output controllers (IOC). In typical data processing systems, the amount of main memory in the system can usually be varied from some minimal amount to some maximum amount with the user of the particular data processing system determining the amount of main memory to be included in its system as a function of the size and number of computer programs to be executed and the amount of data to be processed and the speed with which the data must be processed. Therefore, in a typical data processing system, the amount of main memory actually configured within a particular data processing system can be less than the maximum amount of memory which could be configured. It is desirable to have the system know the actual amount of main memory configured within a particular system for both diagnostic and error detection purposes.
The amount of main memory actually contained within a particular data processing system can be used for diagnostic purposes when the system is initially started a to allow a diagnostic process to determine whether all of the memory contained within the system is functioning properly and when an error in main memory function is detected, an attempt can be made to isolate the error to the particular hardware component which contains a failed element. The amount of main memory actually in the particular system is also useful in detecting errors by either software or hardware that result in an attempt to address a memory location beyond those actually contained in the main memory.
One existing method of determining the actual amount of main memory physically present within a particular data processing system is to execute a firmware or software program which will initially access a memory location within the address space of the minimum amount of memory that can be present in the data processing system and if that access is successful to access a memory location that is in the next amount of memory which can be present in the system and keep incrementing the address of the main memory location to be accessed until either the main memory does not respond or an error is detected. For example, if a data processing system is capable of having up to 256K (one K=1024) words of memory present with each system having at least a minimum of 32K words of memory and with main memory being available in additional increments of 32K word modules, a program could be written to initially address a location within the first 32K words of address space and then incrementing the address so that the address would fall within the address space between 32K words and 64K words and if that access is successful, again incrementing the address by 32K such that the next address would fall between 64K and 96K, and continuing to increment the address until such time as an access failure is detected.
The method for detecting an access error may be as simple as writing a known pattern into the address location and reading it back. If the data read back from the address location is that data which corresponds to a nonexistent memory location, which will in general be either a pattern of all binary ONEs or all binary ZEROs, the sizing program can assume that the addressed location is not present in the particular system and that no memory exists above the module which was last successfully accessed. Alternatively, some data processing systems may provide for an interrupt or trap or some other indication, such as a parity error, when an attempt is made to access a nonexistent memory location. For example, U.S. Pat. No. 4,001,790 entitled, "Modularly Addressable Units Coupled In A Data Processing System Over a Common Bus", describes a system in which an attempt to access a nonexistent memory location will result in a time out occurring because no memory module within the system has responded positively within a predetermined period. This time out will cause the CPU to trap to a software routine to handle the occurrence of an attempt to access a nonexistent memory location. U.S. Pat. No. 4,340,933 entitled, "Data Processing System Having Centralized Nonexistent Memory Address Detection", describes an alternative system wherein the maximum amount of memory thatis physically present within the computer system is set within a switch within the CPU and each attempt to access the memory, whether it be by the CPU or an I/O device via an I/O controller, is compared with this maximum memory present in the system. If the memory address exceeds that which is physically present in the system, no attempt is made to access the memory and a trap occurs which can be handled by a software routine.
Once the maximum amount of physical memory is determined, the diagnostic routine can extensively exercise the memory checking whether each location can be written into and read back from without error and detect memory problems so that they may be reported.
However, because the above described methods for determining the maximum physical memory which is present in the system require than an extensive amount of the logic within the system be functional, there are cases in which a failure within one of many components will result in the diagnostic process thinking that less memory is present in the system than there actually is. This will result in the diagnostic process only exercising the amount of memory which it determines to be in the system and will result in a failure going unreported because the diagnostic program has successfully exercised all of the memory it thought was present but has not exercised some of the memory which is actually present but failed.
Further, the above techniques do not permit the ready determination of which memory module has actually failed in some instances. For example, if the memory system has a memory module which can either contain 32K words of memory or 64K words of memory with each memory module being contained on a single printed circuit board, if the diagnostic program determines that a problem has occurred in the second 32K of memory, it does not necessarily know in which memory module (printed circuit board) the fault is contained in. For example, if a particular system is configured with 96K words of memory, it may be possible to configure that system using a first memory module contains 64K words of memory and a second memory module containing 32K words of memory or a first memory module contains 32K words of memory and a second module containing 64K words of memory or three 32K word modules. In this case, if a fault is detected in the second 32K words of memory, the diagnostic program can not determine whether the first memory module must be replaced which is the case if the first memory module contained 64K words of memory or if the second memory module must be replace which is the case if the first memory module contains only 32K words of memory.
Therefore, what is desired is an inexpensive method of determining the maximum physical memory present within a system which does not involve exercising a large amount of logic so that one can be confident that the maximum amount of memory visible to a diagnostic process is truly the upper limit of physical memory and does not reflect a system having a larger amount of memory, the upper portion of which has failed. Further, it is desired to have a system that permits a fault to be isolated to a failing memory module so that a diagnostic program can indicate to a service person which printed circuit board within the system should be replaced.